package com.shuoyue.ffmpegvideocut.controller.oss;
public class ResultEntity<T> {
    T data;
    Integer code;
    String message;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public static ResultEntity error(String erro) {
        ResultEntity resultEntity = new ResultEntity();
        resultEntity.setCode(501);
        resultEntity.setMessage(erro);
        return resultEntity;
    }


    public static <T> ResultEntity<T> success(T data) {
        ResultEntity<T> resultEntity = new ResultEntity<T>();
        resultEntity.setCode(200);
        resultEntity.setData(data);
        return resultEntity;
    }


}
